package com.education.welco.service.impl;

import com.education.common.utils.Convert;
import com.education.welco.mapper.SQuestionsClassMapper;
import com.education.welco.pojo.SQuestionsClass;
import com.education.welco.service.ISQuestionsClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 试题班级关联 服务层实现
 *
 * @author d
 * @date 2020-06-03
 */
@Service
public class SQuestionsClassServiceImpl implements ISQuestionsClassService {

    @Autowired
    private SQuestionsClassMapper sQuestionsClassMapper;

    /**
     * 查询试题班级关联信息
     *
     * @param id 试题班级关联ID
     * @return 试题班级关联信息
     */
    @Override
    public SQuestionsClass selectSQuestionsClassById(Integer id) {
        return sQuestionsClassMapper.selectSQuestionsClassById(id);
    }

    /**
     * 查询试题班级关联列表
     *
     * @param sQuestionsClass 试题班级关联信息
     * @return 试题班级关联集合
     */
    @Override
    public List<SQuestionsClass> selectSQuestionsClassList(SQuestionsClass sQuestionsClass) {
        return sQuestionsClassMapper.selectSQuestionsClassList(sQuestionsClass);
    }

    /**
     * 新增试题班级关联
     *
     * @param sQuestionsClass 试题班级关联信息
     * @return 结果
     */
    @Override
    public int insertSQuestionsClass(SQuestionsClass sQuestionsClass) {
        return sQuestionsClassMapper.insertSQuestionsClass(sQuestionsClass);
    }

    /**
     * 修改试题班级关联
     *
     * @param sQuestionsClass 试题班级关联信息
     * @return 结果
     */
    @Override
    public int updateSQuestionsClass(SQuestionsClass sQuestionsClass) {
        return sQuestionsClassMapper.updateSQuestionsClass(sQuestionsClass);
    }

    /**
     * 删除试题班级关联
     *
     * @param catalogId 试题班级关联ID
     * @return 结果
     */
    @Override
    public int deleteSQuestionsClassByCatalogId(Integer catalogId) {
        return sQuestionsClassMapper.deleteSQuestionsClassByCatalogId(catalogId);
    }

    /**
     * 删除试题班级关联对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSQuestionsClassByIds(String ids) {
        return sQuestionsClassMapper.deleteSQuestionsClassByIds(Convert.toStrArray(ids));
    }
}